<template>
  <div class="d-container">
    <div class="g-container">
      <div>
        <span class="title">任务总数</span>
        <div class="content">
          <div v-for="item in databasesNum">
            <p class="tag">
              <span>{{ item.num }}</span>
            </p>
            <p class="name">{{ item.name }}</p>
          </div>
        </div>
      </div>
      <div>
        <span class="title">新上线系统数</span>
        <div class="content content2">
          <div>
            <p class="tag"><span>5678</span></p>
            <p class="name">近三月上线系统数</p>
          </div>
        </div>
      </div>
      <div>
        <span class="title">系统登记数及标准符合率</span>
        <div>
          <rateBar />
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from "vue";
import rateBar from "./charts/bar1.vue";

let databasesNum = ref([
  {
    name: "MySQL",
    num: 6453,
  },
  {
    name: "SqlServer",
    num: 32511,
  },
  {
    name: "PGSQL",
    num: 3543,
  },
]);
</script>

<style scoped lang="scss">
.d-container {
  height: 100%;
  padding: 40px 10px 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;

  .content {
    flex: 1;
  }
}
.g-container {
  height: 100%;
  display: flex;
  justify-content: space-between;

  p {
    padding: 0;
    margin: 0;
  }

  > div {
    display: flex;
    flex-direction: column;
    padding: 20px 10px 10px;
    box-sizing: border-box;
    border-radius: 4px;
    background-color: rgba(11, 44, 106, 0.6);

    &:first-child {
      width: 28%;
    }

    &:nth-child(2) {
      width: 19%;
    }

    &:nth-child(3) {
      width: 51%;
    }

    .title {
      position: relative;
      height: 26px;
      padding-left: 20px;
      font-size: 16px;
      font-weight: bold;
      color: transparent;
      background-image: linear-gradient(to bottom, #fff, #98bbff);
      -webkit-background-clip: text;
      background-clip: text;

      &:before {
        content: "";
        position: absolute;
        width: 10px;
        height: 10px;
        left: 0;
        top: 7px;
        background-color: #3a8fff;
        clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
      }
    }

    .content {
      flex: 1;
      display: flex;
      justify-content: space-between;

      > div {
        width: 33%;
        display: flex;
        flex-direction: column;
        justify-content: center;

        .tag {
          width: 80px;
          height: 90px;
          margin: 0 auto;
          padding-top: 1px;
          text-align: center;
          background: url("../../../static/icon1.png") no-repeat center center;
          background-size: 100% 100%;

          span {
            display: block;
            margin-top: 30px;
            font-size: 18px;
            font-weight: bold;
            color: transparent;
            background-image: linear-gradient(to bottom, #fff, #00effe);
            -webkit-background-clip: text;
            background-clip: text;
          }
        }

        .name {
          font-size: 14px;
          color: #fff;
          text-align: center;
        }
      }

      &.content2 {
        > div {
          width: 100%;
        }
      }
    }
  }
}
</style>
